﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace Paxnam
{
    class Pill:GameObject
    {
        public enum Types
        {
 
        }

        SoundEffect soundEffect;
        /// <summary>
        /// tempo do efeito da pilula no player
        /// </summary>
        private float duration;
       

        public Pill(Texture2D texture, SoundEffect soundEffect, GameWindow Window)
        {
            this.Texture = texture;
            this.Window = Window;
            this.random = new Random();
            this.soundEffect = soundEffect;
            this.myColor = Color.Blue;

          

            PillManager.pills.Add(this);
        }

        public override void Update()
        {
            
        }

        public void Update(Player snake)
        {
            
            if (snake.CollisionRect.Intersects(this.CollisionRect)&& Visible)
            {
                Visible = false;
                soundEffect.Play();
                
            }
        }

        
    }

}
